/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package MortgageCore;

/**
 *
 * @author karakots
 */
public class MortgageOffer {
	static public enum Type {
		Bid,
		Ask
	}

    private Type type;
    private MortgageTerms terms;
    private iBuyerSeller agent;
    private boolean isActiveOffer;
    private double  amountToBorrow;
    private int daysOfferValid;
    private boolean isAccepted;

    public MortgageOffer() {
        terms = new MortgageTerms();
        isActiveOffer = false;
        amountToBorrow = 0;
        daysOfferValid = 0;
        isAccepted = false;
    }

    public iBuyerSeller getAgent()                  {return agent;}
    public void setAgent(iBuyerSeller a)            {agent = a;}
    public Type getType()                           {return type;}
    public void setType(Type t)                     {type = t;}
    public boolean getIsActiveOffer()               {return isActiveOffer;}
    public void setIsActiveOffer(boolean b)         {isActiveOffer = b;}
    public MortgageTerms getMortgageTerms()         {return terms;}
    public void setAmountToBorrow(double amount) {amountToBorrow = amount;}
    public double getAmountToBorrrow()           {return amountToBorrow;}
    public void setDaysOfferValid(int d)            {daysOfferValid = d;}
    public int getDaysOfferValid()                  {return daysOfferValid;}
    public MortgageTerms getTerms()                 {return terms;}
    public boolean getIsAccepted()                  {return isAccepted;}
    public void setIsAccepted(boolean b)            {isAccepted = b;}

    public int ageOffer() {
        if (daysOfferValid > 0)
         daysOfferValid -= 1;
        return daysOfferValid;
    }
}
